<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['namespace' => 'Wap','middleware'=> ['configs','pc']], function () {
    Route::any('/login', 'AuthController@login')->name('wap.auth.login'); //登录
    Route::any('/register', 'AuthController@register')->name('wap.auth.register'); //注册
    Route::post('/three', 'AuthController@three')->name('wap.auth.three'); //第三方登录跳转
    Route::post('/sms', 'AuthController@sms')->name('wap.auth.sms'); //发送短信
    Route::get('/logout', 'AuthController@logout')->name('wap.auth.logout'); //登录
    Route::any('/find', 'AuthController@find')->name('wap.auth.find'); //找回密码

    Route::get('/', 'IndexController@index')->name('wap.index.index'); //首页
    Route::get('/search', 'IndexController@search')->name('wap.index.search'); //搜索
    Route::get('/about', 'IndexController@about')->name('wap.index.about'); //单页
    Route::group(['prefix' => 'new'], function () {
        Route::get('/info', 'IndexController@info')->name('wap.new.info'); //新闻详情
        Route::post('/praise','IndexController@praise')->name('wap.new.praise');//点赞
    });

    Route::group(['prefix' => 'live'], function () {
        Route::get('/', 'LiveController@index')->name('wap.live.index'); //快讯
    });
//    Route::group(['prefix' => 'college'], function () {
//        Route::get('/', 'CollegeController@index')->name('home.college.index'); //学院
//        Route::get('/info', 'CollegeController@info')->name('home.college.info'); //学院详情
//        Route::get('/download', 'CollegeController@download')->name('home.college.download'); //下载
//    });
    Route::group(['prefix' => 'column'], function () {
        Route::get('/', 'ColumnController@index')->name('wap.column.index'); //专栏
        Route::get('/info', 'ColumnController@info')->name('wap.column.info'); //专栏详情
    });
    Route::group(['prefix' => 'project'], function () {
        Route::get('/', 'ProjectController@index')->name('wap.project.index'); //项目
        Route::get('/info', 'ProjectController@info')->name('wap.project.info'); //项目详情
    });
    Route::group(['prefix' => 'user','middleware'=> ['auth']], function () {
        Route::get('/',        'UserController@index')->name('wap.user.index'); //首页
        Route::any('/detail',  'UserController@detail')->name('wap.user.detail'); //编辑用户信息
        Route::any('/password','UserController@password')->name('wap.user.password'); //修改密码
        Route::any('/join',    'UserController@join')->name('wap.user.join'); //专栏申请
        Route::get('/praise',  'UserController@praise')->name('wap.user.praise'); //点赞记录
        Route::get('/article', 'UserController@article')->name('wap.user.article'); //发布列表
        Route::any('/publish', 'UserController@publish')->name('wap.user.publish'); //发布数据
        Route::any('/edit',    'UserController@edit')->name('wap.user.edit'); //编辑数据
        Route::post('/destroy','UserController@destroy')->name('wap.user.destroy'); //删除数据
    });
});
